.
In this way, in win7, only the system has the access permission, the old program will call the old path through junction point, and then access the user data files or system data folders under win7.
For example, if win7 creates a connection point for each user, the old c: \ Users \Username\ My Documents points to c: \ Users \ under win7 \Username\ Documents. The following table shows
Path in XP and Windows2003
Paths in win7 and windows2008
\ Documents ents a
1. Open VS. NET 2003.2. Create a New WinForm Application.
3. Add a namespace
Using System;Using System. Drawing;Using System. Collections;Using System. ComponentModel;Using System. Windows. Forms;Using System. Data;Using System. Net;Using System. Net. Sockets;Using System. Text;Using System. IO;
4. Main Code
To prevent deadlocks on the interface when connecting to the server, I opened another thread.
Private void button#click (object sender
Os.environ module functions Function: Get system environment variable "no parameter" How to use:Os.environ Format such as: a = Os.environ #!/usr/bin/env python #-*-Coding:utf8-*-import os a = Os.environ #获取系统环境变量 for I in a: #循环出系统环境变量 Print (i) #输出 # userprofile # COMSPEC # PYTHONPATH # processor_level # OS # USERNAME # allusersprofile # programfiles (X86) # Progra Mfiles # number_of_processors # PROGRAMDATA # localappdata # public # psmodulepath # commonprogramfiles (X86) # homedr
example:[Code]Os.exit (1)
Os.getenv (varname)-
Function: Returns the value of the environment variable varname the current process, and returns nil if the variable is undefined
For example:
Copy Code code as follows:
Print (Os.getenv ("UserDomain"))
Print (Os.getenv ("SystemRoot"))
Print (Os.getenv ("Os2LibPath"))
Print (Os.getenv ("ProgramFiles"))
Print (Os.getenv ("AppData"))
Print (Os.getenv ("AllUsersProfile"))
Print (Os.getenv ("CommonProgramFiles"))
and Settings\Administrator The exact command line to start the current Cmd.exe %cmdcmdline% The version number of the current command handler extension %cmdextversion% The name of the computer %computername% The exact path of the command-line interpreter to execute the program %comspec% Current date %date% Current time (accurate to milliseconds) %time% Error code for the previous command %errorlevel% Verify the name of the domain controller for the current logon session %
directory is specified in Local Users and groups.The%homepath% system returns the full path of the user's home directory. Set based on the value of the home directory. The user home directory is specified in Local Users and groups.The%homeshare% system returns the network path of the user's shared home directory. Set based on the value of the home directory. The user home directory is specified in Local Users and groups.%logonserver% Local returns th
directory is specified in Local Users and groups.The%homeshare% system returns the network path of the user's shared home directory. Set based on the value of the home directory. The user home directory is specified in Local Users and groups.%logonserver% Local returns the name of the domain controller that verifies the current logon session.The%number_of_processors% system specifies the number of processors installed on the computer.The%os% system r
parameter, X is used as the root path. That is, when the X path is reached, the up action is not allowed.If we do not use/root, the object x we are viewing is a sub-object, we can browse its ancestors or objectsExample: Browse only the C: disk:explorer/e,/root,c: Explorer/root,%systemdrive% Browse only the Windows directory:explorer/e,/root,%windir% Browse only the logon server (you can use a UNC path):explorer/e,/root,%logonserver% To browse only th
-line interpreter executable program.The%date% system returns the current date. Use the same format as the date/t command. Generated by Cmd.exe. For more information about the date command, see Date.The%errorlevel% system returns the error code for the previous command. Errors are usually indicated by a value other than 0.The%homedrive% system returns the local workstation drive letter that is connected to the user's home directory. Set based on the value of the home directory. The user home dir
to use the Dubbo RPC service, add a reference to the service, and add @reference annotations: (here Reference the declaration annotations for the Dubbo service Com.alibaba.dubbo.config.annotation.Reference Public class Testcostumer { @Reference private testservice s; Private int i = 0; @Value ("${crystal.application.name}") private String name; Public void Hello () { + "" + system.getenv ("logonserver") + "-" + + +i));}
% Allusersprofile % Description: Path to the total configuration file directory of all users: C: \ Documents ents and Settings \ All Users % USERPROFILE % Description: The Path to the configuration file directory of the current user: c: \ Documents ents and Settings \ Weste % homepath % Description: The Path to the current user's configuration file directory: C: \ Documents ents and Settings \ Weste % systemdrive % description: path of the System Disk: C: \ % homedrive % Description: Path of the
-line interpreter executable program.The%date% system returns the current date. Use the same format as the date/t command. Generated by Cmd.exe. For more information about the date command, see Date.The%errorlevel% system returns the error code for the previous command. Errors are usually indicated by a value other than 0.The%homedrive% system returns the local workstation drive letter that is connected to the user's home directory. Set based on the value of the home directory. The user home dir
% Comspec %
Description: file path of cmd.exe
Path: c: \ windows \ system32 \ cmd.exe
% Logonserver %
Description: file path of cmd.exe
Path: \ icech
You can also run the SET command in cmd to view the preceding variable settings. You can also right-click "my computer", select "system properties-advanced-system variables", and manually add variables to system variables.
========================================================== =======
: returns the varname value of the environment variable of the current process. If the variable is not defined, Nil is returned.
For example:Print (OS. getenv ("userdomain "))Print (OS. getenv ("systemroot "))Print (OS. getenv ("os2libpath "))Print (OS. getenv ("ProgramFiles "))Print (OS. getenv ("appdata "))Print (OS. getenv ("allusersprofile "))Print (OS. getenv ("commonprogramfiles "))Print (OS. getenv ("computername "))Print (OS. getenv ("username "))Print (OS. getenv ("USERPROFILE "))Print
: C :\
% WINDIR %
Description: directory of the system.
Path: C: \ WINDOWS
% SystemRoot %
Description: root directory of Windows
Path: C: \ WINDOWS
% System %
Description: Windows Directory
Path: c: \ windows \ system32
% Temp %
Note: This is the directory where the temporary folder of the system is located.
Path: C: \ Documents ents and Settings \ User Name \ LocalSettings \ Temp
% TMP %
Note: This is the directory where the temporary folder of the system is located.
Path: C: \ Documents ents a
How can I view the domain controller on which the client logs in?Enter "set logonserver" in the DOS client to view which domain controller is currently logged on to the client, as shown in,650) This. width = 650; "Title =" 1.jpg" src = "http://s3.51cto.com/wyfs02/M01/42/70/wKiom1PXcLmzTsPzAAERNjPn-Fo020.jpg" alt = "wKiom1PXcLmzTsPzAAERNjPn-Fo020.jpg"/>This article is from the "Welcome to zybench .." blog, please be sure to keep this source http://zyli
network path of the user's shared home directory. Set Based on the main directory value. The user home directory is specified in "local users and groups.% Logonserver % local return the name of the domain controller that verifies the current logon session.% Number_of_processors % Number of processors installed on the computer.% OS % The system returns the operating system name. Windows 2000 displays windows _ NT as its operating system.% PATH % The s
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.